package com.lagou.edu.controller;

import com.lagou.edu.service.ICodeService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description TODO
 * @Classname CodeController
 * @Date 2021/5/30 17:17
 * @Author ch'ien
 */
@RestController
@RequestMapping("/code")
public class CodeController {

    @Reference
    private ICodeService codeServer;


    @GetMapping("/create/{email}")
    public Boolean create(@PathVariable String email){

        return codeServer.create(email);
    }


    @GetMapping("/validate/{email}/{code}")
    public int validate(@PathVariable String email, @PathVariable String code){

        return codeServer.validate(email, code);
    }


}
